package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 预测结果表，存储ARIMA模型预测结果
 * @TableName prediction_result
 */
@TableName(value ="prediction_result")
@Data
public class PredictionResult {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 预测月份
     */
    private Date predictionMonth;

    /**
     * 预测类型(T:总金额,G:分组)
     */
    private String predictionType;

    /**
     * 分组维度(如province,country等)
     */
    private String groupDimension;

    /**
     * 分组值(如广东省,美国等)
     */
    private String groupValue;

    /**
     * 预测中间值
     */
    private BigDecimal middleValue;

    /**
     * 实际值
     */
    private BigDecimal actualValue;

    /**
     * 置信区间下限
     */
    private BigDecimal confidenceLower;

    /**
     * 置信区间上限
     */
    private BigDecimal confidenceUpper;

    /**
     * 置信水平(如90,95)
     */
    private Integer confidenceLevel;

    /**
     * 使用的历史数据月份数
     */
    private Integer historyMonths;

    /**
     * 所属关区ID(0表示全国)
     */
    private Integer customsId;

    /**
     * 币制
     */
    private String currencyType;

    /**
     * 是否异常
     */
    private Integer isAbnormal;

    /**
     * 
     */
    private Date createTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PredictionResult other = (PredictionResult) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPredictionMonth() == null ? other.getPredictionMonth() == null : this.getPredictionMonth().equals(other.getPredictionMonth()))
            && (this.getPredictionType() == null ? other.getPredictionType() == null : this.getPredictionType().equals(other.getPredictionType()))
            && (this.getGroupDimension() == null ? other.getGroupDimension() == null : this.getGroupDimension().equals(other.getGroupDimension()))
            && (this.getGroupValue() == null ? other.getGroupValue() == null : this.getGroupValue().equals(other.getGroupValue()))
            && (this.getMiddleValue() == null ? other.getMiddleValue() == null : this.getMiddleValue().equals(other.getMiddleValue()))
            && (this.getActualValue() == null ? other.getActualValue() == null : this.getActualValue().equals(other.getActualValue()))
            && (this.getConfidenceLower() == null ? other.getConfidenceLower() == null : this.getConfidenceLower().equals(other.getConfidenceLower()))
            && (this.getConfidenceUpper() == null ? other.getConfidenceUpper() == null : this.getConfidenceUpper().equals(other.getConfidenceUpper()))
            && (this.getConfidenceLevel() == null ? other.getConfidenceLevel() == null : this.getConfidenceLevel().equals(other.getConfidenceLevel()))
            && (this.getHistoryMonths() == null ? other.getHistoryMonths() == null : this.getHistoryMonths().equals(other.getHistoryMonths()))
            && (this.getCustomsId() == null ? other.getCustomsId() == null : this.getCustomsId().equals(other.getCustomsId()))
            && (this.getCurrencyType() == null ? other.getCurrencyType() == null : this.getCurrencyType().equals(other.getCurrencyType()))
            && (this.getIsAbnormal() == null ? other.getIsAbnormal() == null : this.getIsAbnormal().equals(other.getIsAbnormal()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPredictionMonth() == null) ? 0 : getPredictionMonth().hashCode());
        result = prime * result + ((getPredictionType() == null) ? 0 : getPredictionType().hashCode());
        result = prime * result + ((getGroupDimension() == null) ? 0 : getGroupDimension().hashCode());
        result = prime * result + ((getGroupValue() == null) ? 0 : getGroupValue().hashCode());
        result = prime * result + ((getMiddleValue() == null) ? 0 : getMiddleValue().hashCode());
        result = prime * result + ((getActualValue() == null) ? 0 : getActualValue().hashCode());
        result = prime * result + ((getConfidenceLower() == null) ? 0 : getConfidenceLower().hashCode());
        result = prime * result + ((getConfidenceUpper() == null) ? 0 : getConfidenceUpper().hashCode());
        result = prime * result + ((getConfidenceLevel() == null) ? 0 : getConfidenceLevel().hashCode());
        result = prime * result + ((getHistoryMonths() == null) ? 0 : getHistoryMonths().hashCode());
        result = prime * result + ((getCustomsId() == null) ? 0 : getCustomsId().hashCode());
        result = prime * result + ((getCurrencyType() == null) ? 0 : getCurrencyType().hashCode());
        result = prime * result + ((getIsAbnormal() == null) ? 0 : getIsAbnormal().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", predictionMonth=").append(predictionMonth);
        sb.append(", predictionType=").append(predictionType);
        sb.append(", groupDimension=").append(groupDimension);
        sb.append(", groupValue=").append(groupValue);
        sb.append(", middleValue=").append(middleValue);
        sb.append(", actualValue=").append(actualValue);
        sb.append(", confidenceLower=").append(confidenceLower);
        sb.append(", confidenceUpper=").append(confidenceUpper);
        sb.append(", confidenceLevel=").append(confidenceLevel);
        sb.append(", historyMonths=").append(historyMonths);
        sb.append(", customsId=").append(customsId);
        sb.append(", currencyType=").append(currencyType);
        sb.append(", isAbnormal=").append(isAbnormal);
        sb.append(", createTime=").append(createTime);
        sb.append("]");
        return sb.toString();
    }
}